﻿using System;
using log4net;
using Microsoft.Practices.Prism.Logging;

namespace MassPokerTool.Infrastructure.Logging
{
    public class Logger : ILoggerFacade, ILogger
    {
        private readonly ILog _log;

        public Logger(Type type)
        {
            _log = LogManager.GetLogger(type);
        }

        public void Log(string message, Category category, Priority priority)
        {
            var fullMessage = message + "[Priority: " + priority + "]";

            switch (category)
            {
                case Category.Debug:
                    _log.Debug(fullMessage);
                    break;
                case Category.Info:
                    _log.Info(fullMessage);
                    break;
                case Category.Warn:
                    _log.Warn(fullMessage);
                    break;
                case Category.Exception:
                    _log.Error(fullMessage);
                    break;
            }
        }

        public void Debug(object message)
        {
            _log.Debug(message);
        }

        public void Info(object message)
        {
            _log.Info(message);
        }

        public void Warn(object message)
        {
            _log.Warn(message);
        }

        public void Error(object message)
        {
            _log.Error(message);
        }
    }
}
